import javax.sound.midi.Soundbank;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.Map;

/**
 * ClassName EnumTest
 * Description TODO
 * Author Hexiao
 * Date 2018/8/22 10:32
 * Version 1.0
 **/
public class EnumTest {
    public static void  test(){
        WeekDayEnum weekDayEnum=WeekDayEnum.MONDAY;
        switch(weekDayEnum){
            case MONDAY:
                System.out.println(WeekDayEnum.MONDAY);
                break;
            case TUESDAY:
                System.out.println(WeekDayEnum.TUESDAY);
            case WENNESDAY:
                System.out.println(WeekDayEnum.WENNESDAY);
            case THURSDAY:
                System.out.println(WeekDayEnum.THURSDAY);
            case FRIDAY:
                System.out.println(WeekDayEnum.FRIDAY);
            case SATURDAY:
                System.out.println(WeekDayEnum.SATURDAY);
            case SUNDAY:
                System.out.println(WeekDayEnum.SUNDAY);
        }
    }
    public static void printAll(){
        for (WeekDayEnum weekDayEnum:WeekDayEnum.values()){
            System.out.println("weekDayEnum's ordinal= "+weekDayEnum.ordinal()+","+weekDayEnum.name());//返回这个枚举常数的顺序
        }
    }
    public  static  void  collection(){
        EnumMap<Course,String> enumMap=new EnumMap<Course,String>(Course.class);
        enumMap.put(Course.ONE,"语文1");
        enumMap.put(Course.TWO,"语文2");
        enumMap.put(Course.THREE,"语文3");
        enumMap.put(Course.ONE,"语文4");
//        for (Map.Entry<Course,String> entry:enumMap.entrySet()){
//            System.out.println(entry.getKey()+" "+entry.getValue());
//        }
        EnumSet<WeekDayEnum> enums=EnumSet.allOf(WeekDayEnum.class);
        System.out.println(enums);
        EnumSet<WeekDayEnum> enums2=EnumSet.of(WeekDayEnum.MONDAY,WeekDayEnum.FRIDAY);
        System.out.println(enums2);
        EnumSet<WeekDayEnum> enums4=EnumSet.complementOf(enums2);
        System.out.println(enums4);
        EnumSet<WeekDayEnum> enums3=EnumSet.range(WeekDayEnum.MONDAY,WeekDayEnum.FRIDAY);
        System.out.println(enums3);
    }
    public static void main(String[] args){
//       test();
//        printAll();
        collection();
    }

}